package com.koron.css2.workflow;

import com.koron.css2.serviceManage.bean.UserInfoBean;
import com.koron.util.Constant;
import org.apache.commons.lang3.StringUtils;
import org.koron.ebs.mybatis.SessionFactory;
import org.swan.bean.MessageBean;

import java.util.Map;

/**
 * 流程提交，包括启动流程
 * @author admin
 *  
 */ 
public class ProcessCommit extends AbstractProcessCommit {
	
	public MessageBean<?> before(SessionFactory factory, UserInfoBean userInfo, Map<String, String> param){
		MessageBean<Void> info = MessageBean.create(Constant.MESSAGE_INT_SUCCESS, "success", Void.class);
		String receiptType = param.get("receiptType");
		if(StringUtils.isEmpty(receiptType)) {
			info.setCode(Constant.MESSAGE_INT_FAIL);
			info.setDescription("单据类型不能为空");
			return info;
		}
		return info;
	};
}
